package jp.ac.segakuen;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class OpenCampassMenuTableServlet extends HttpServlet {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1130L;
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException ,ServletException {
	    String action = req.getParameter("submit");
	    if(action.equals("項目追加")){
	    	  OpenCampassMenuTableUtil.insertNew(req.getParameter("id"), req.getParameter("cource"));
	    	  getServletContext().getRequestDispatcher("/ajaxmail/listOCDateItemData.jsp").forward(req,resp);
	      } else if(action.equals("内容削除")){
	    	  OpenCampassMenuTableUtil.deleteByDateId(req.getParameter("omid"));
	    	  getServletContext().getRequestDispatcher("/ajaxmail/listOCDateItemData.jsp").forward(req,resp);
	      } else {
	      
	      }  
	    }
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
	throws IOException,ServletException{
		doPost(req,resp);
	}
}
